package ThreadSleepTest;

/**
 * ClassName ThreadSleepTest
 * Description TODO
 * Author Hexiao
 * Date 2018/8/24 15:42
 * Version 1.0
 **/
// 在进入sleep 状态时，线程不占用处理器，操作系统可以调度其他程序执行
public class ThreadSleepTest {
    public static void main(String[] args){
      ThreadSleep t1=new ThreadSleep();
      t1.time=3000;
      ThreadSleep t2=new ThreadSleep();;
      t2.time=5000;
      ThreadSleep t3=new ThreadSleep();
      t1.other=t2;
      t3.time=10000;
      t3.setDaemon(true);//设置线程为“守护线程”；在没有用户线程可服务时会自动离开(最低的优先级)
      t1.start();
      t2.start();
      t3.start();
      System.out.println("end...........");
    }
}